import App from './App'

import {    $http} from '@escook/request-miniprogram'
// 过载的自定义属性uni.$http = $http// 全局根路径$http.baseUrl='https://www.uinav.com'// 请求拦截器$http.beforeRequest = function(options){    uni.showLoading({        title:"数据加载中..."    })
    
    // 判断是否有权限进行请求 API接口
    if(options.url.indexOf('/my/') !== -1){
        options.header = {
            Authorization: store.state.m_user.token
        }
    }}// 响应拦截器$http.afterRequest = function(){    uni.hideLoading()}

// 封装信息提示
uni.$showMsg = function(title = '数据请求失败!' , duration = 1500){
    uni.showToast({
        title,
        duration,
        icon:'none'
    })
}


// #ifndef VUE3
import Vue from 'vue'
import store from './store/store.js'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    // 挂载实例
    ...App,
    store,
})
app.$mount('#app')
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue';
import store from './store/store.js'
export function createApp() {
  const app = createSSRApp(App)
  app.use(store)
  return {
    app
  }
}
// #endif